package com.example.springboot.service.imp;

import com.example.springboot.bean.Department;
import com.example.springboot.bean.Employee;
import com.example.springboot.repository.DepartmentRepository;
import com.example.springboot.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

/**
 * Created by tang on 2017/12/8.
 */
@Service
public class DepartmentServiceImp implements DepartmentService {

    @Autowired
    DepartmentRepository departmentRepository;

    @Override
    public Iterable<Department> findAll(Pageable pageable) {
        return departmentRepository.findAll(pageable);
    }

    @Override
    public Iterable<Department> findAll() {
        return departmentRepository.findAll();
    }

    @Override
    public long count() {
        return departmentRepository.count();
    }
}
